﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OnlineGames
{
    public class cl_0423_DeathState : cl_0423_State
    {
        public cl_0423_DeathState(cl_0423_State state)
        {
            this.player = state.player;
            this.behavior = state.getBehavior();
            this.stateName = "死亡状态!";
            Console.WriteLine("进入" + this.stateName);
        }

        public override void pause()
        {
            Console.WriteLine("点击暂停");
            this.behavior = "暂停";
            checkState();
        }

        public override void start()
        {
            Console.WriteLine("重新开始游戏");
            this.behavior = "开始";
            checkState();
        }

        public override void beAttacked()
        {
            Console.WriteLine("已死亡，无法被射击");
        }

        public override void shot()
        {
            Console.WriteLine("已死亡，无法攻击敌方");
        }

        public override void move()
        {
            Console.WriteLine("已死亡，无法移动位置");
        }

        public void checkState()
        {
            if (this.behavior == "开始")
            {
                player.setState(new cl_0423_NormalState(this));
            }
            else if (this.behavior == "暂停")
            {
                player.setState(new cl_0423_PauseState(this));
            }
        }
    }
}